
<style>
    .form-signin {
        max-width: 330px;
        padding: 15px;
        margin: 0 auto;
    }
    .form-signin .form-signin-heading,
    .form-signin .checkbox {
        margin-bottom: 10px;
    }
    .form-signin .checkbox {
        font-weight: normal;
    }
    .form-signin .form-control {
        position: relative;
        height: auto;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        padding: 10px;
        font-size: 16px;
    }
    .form-signin .form-control:focus {
        z-index: 2;
    }
    .form-signin input[type="email"] {
        margin-bottom: -1px;
        border-bottom-right-radius: 0;
        border-bottom-left-radius: 0;
    }
    .form-signin input[type="password"] {
        margin-bottom: 10px;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
</style>

<?php
$model = new BDynamicFormModel();
$roleNameField = 'media_roleName_addChildRole';
$roleAliasField = 'media_roleAlias_addChildRole';

$model->addField($roleNameField);
$model->addField($roleAliasField);
?>

<?php
$form = $this->beginWidget('CActiveForm', array(
    "id" => "manage-addRole-form",
    'enableAjaxValidation' => FALSE,
    'htmlOptions' => array('class' => '', 'role' => 'form'),
        ));
$parentRole = new BRole($parentRoleId);
$appId = $parentRole->appId;
$app = BApp::getAppById($appId);
$appClass = get_class($app);
$roleFullName = $parentRole->getFullName();
$fullName = str_replace('app_root.', $appClass . '::', $roleFullName);
?>
<legend>
    <h4><?php
        echo $control->getAjaxLink(array('name' => '功能列表', 'id' => 'showEventList'), array(
            'cooker' => 'BAEvent@showEventList'
        ));
        ?>\
        <?php
        echo $control->getAjaxLink('管理角色', array(
            'cooker' => 'BAEvent@showEventHome'
        ));
        ?>\
        <?php
        echo $control->getAjaxLink('机构角色', array(
            'cooker' => 'BARoleCooker@showSpaceRoleList'
        ));
        ?>\
        添加机构角色 
    </h4>
</legend>
<div>父角色名称:&nbsp;<?php echo yii::t('site', $appClass) . '::' . BARoleCooker::getRoleAliasByFullName($roleFullName); ?></div>
<div>父角色全名:&nbsp;<?php echo $fullName; ?></div>
<?php
echo '<br>';
echo CHtml::label('角色名称：', 'roleName');
echo CHtml::activeTextField($model, $roleNameField, array(
    'class' => 'form-control',
    'placeholder' => '英文名称', 'required' => 'true', 'autofocus' => 'true'));
echo CHtml::label('角色别名' . '：', 'roleAlias');
echo CHtml::activeTextField($model, $roleAliasField, array(
    'class' => 'form-control',
    'placeholder' => '别名',
    'required' => 'true'));
?>
<label></label>
<?php
echo $control->getAjaxLink(
        '保存角色', array(
    'cooker' => 'BARole@addChildRole',
    'parentRoleId' => $parentRoleId,
    'htmlOptions' => array(
        'class' => 'btn btn-primary')));
?>
<?php $this->endWidget(); ?>